import { apiGet, apiPost } from "./login_api";

export function getCode() {
    return new Promise((resolve, reject) => {
        apiGet("index.php/index/index/getcode").then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function login(obj) {
    return new Promise((resolve, reject) => {
        apiPost("index/login", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function getAllStudentList(obj) {
    return new Promise((resolve, reject) => {
        apiPost("User/getAllStudentList", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function addWxUser(obj) {
    return new Promise((resolve, reject) => {
        apiPost("User/addWxUser", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function delWxUser(obj) {
    return new Promise((resolve, reject) => {
        apiPost("User/delWxUser", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function getUsers(obj) {
    return new Promise((resolve, reject) => {
        apiPost("User/getUsers", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}

export function getUsersinfo(obj) {
    return new Promise((resolve, reject) => {
        apiPost("User/getWxUserbyid", obj).then(res => {
            resolve(res);
        }).catch(err => {
            reject(err);
        })
    })
}